package net.devkit.core.pojo.db;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import net.devkit.core.pojo.DevCommandPOJO;

import org.hibernate.annotations.GenericGenerator;


/**
 * The persistent class for the user database table.
 * 
 */
@Entity
@Table(name="user")
public class User extends DevCommandPOJO<User>{
	/**
	 * 
	 */
	private static final long serialVersionUID = 4555022919924421526L;
	/**
	 * 
	 */
	private String id;
	private String email;
	private Boolean isDel;
	private String nickName;
	private String passwd;
	private Short sex;
	private Short status;
	private String telNum;
	private String userName;
	private Dept dept;

	public static final Short STATUS_DISABLE = Short.valueOf("0");
	public static final Short STATUS_ENABLE = Short.valueOf("1");
	
	public static final Short SEX_FEMALE = Short.valueOf("0");
	public static final Short SEX_MALE = Short.valueOf("1");
	
	public User() {
	}

	
	public User(String id) {
		super();
		this.id = id;
	}


	@Id
	@Column(unique=true, nullable=false, length=36)
	@GenericGenerator(name = "generator", strategy = "org.hibernate.id.UUIDGenerator")
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}


	@Column(name="E_MAIL", length=50)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}


	@Column(name="IS_DEL")
	public Boolean getIsDel() {
		return this.isDel;
	}

	public void setIsDel(Boolean isDel) {
		this.isDel = isDel;
	}


	@Column(name="NICK_NAME", length=20)
	public String getNickName() {
		return this.nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}


	@Column(length=50)
	public String getPasswd() {
		return this.passwd;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}


	public Short getSex() {
		return this.sex;
	}

	public void setSex(Short sex) {
		this.sex = sex;
	}


	public Short getStatus() {
		return this.status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}


	@Column(name="TEL_NUM", length=20)
	public String getTelNum() {
		return this.telNum;
	}

	public void setTelNum(String telNum) {
		this.telNum = telNum;
	}


	@Column(name="USER_NAME", length=20)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	//bi-directional many-to-one association to Dept
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="DEP_ID")
	public Dept getDept() {
		return this.dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}

	@Override
	public int compareTo(User o) {
		// TODO Auto-generated method stub
		return 0;
	}

}